package com.fishV.BI.MQ;

import com.fishV.BI.constant.RabbitMQConstant;
import com.fishV.BI.model.entity.Chart;
import org.springframework.amqp.rabbit.core.RabbitMessagingTemplate;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author yuwei
 * @date 11:04 2024/10/20
 */
@Component
public class RabbitMQProducer {
    @Resource
    private RabbitTemplate rabbitMQTemplate;
    public void sendMessage(Chart message) {
        // TODO: 实现发送消息到RabbitMQ的逻辑
        rabbitMQTemplate.convertAndSend(RabbitMQConstant.EXCHANGE_NAME,RabbitMQConstant.ROUTING_KEY,message);

    }
}
